package com.maclogic.appcomw;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

public class Act_Main extends Activity implements OnClickListener {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.act_main);
		
		// TextView
		TextView lTxvUser =(TextView) findViewById(R.id.AMuser);
		
		//Button
		Button lBtnLart=(Button) findViewById(R.id.AMBtnLart);
		lBtnLart.setOnClickListener(this);
		
		Button lBtnBout=(Button) findViewById(R.id.AMBtnBout);
		lBtnBout.setOnClickListener(this);
		
		Button lBtnPan=(Button) findViewById(R.id.AMBtnPan);
		lBtnPan.setOnClickListener(this);
		
		Button lBtnCont=(Button) findViewById(R.id.AMBtnCont);
		lBtnCont.setOnClickListener(this);
		
		ImageView lBtnQuit=(ImageView) findViewById(R.id.AMBtnQuit);
		lBtnQuit.setOnClickListener(this);
		
		Bundle lBundel=this.getIntent().getExtras();

		String lLogin="";
		if(lBundel!=null){

			lLogin=lBundel.getString("user");
		}

		lTxvUser.setText(" "+lLogin);
		
		Agc glob= (Agc) this.getApplication();
		
		lLogin=glob.getuser();
		
		lTxvUser.setText(" "+lLogin);
	}

	@Override
	public void onClick(View pv) {
		switch (pv.getId()) {
		case R.id.AMBtnLart:
			Intent lintHM= new Intent(this,Act_Listart.class);
			startActivity(lintHM);
			//finish();
			break;

		case R.id.AMBtnBout:
			/*Intent lintHM= new Intent(this,Act_Main.class);
			lintHM.putExtra("user", _mEdtLog.getText().toString());
			startActivity(lintHM);
			finish();*/
			break;

		case R.id.AMBtnPan:
			Intent lintHP= new Intent(this,Act_Pan.class);
			startActivity(lintHP);
			break;

		case R.id.AMBtnCont:
			Intent lintMC= new Intent(this,Act_Contact.class);
			//lintHM.putExtra("user", _mEdtLog.getText().toString());
			startActivity(lintMC);
			//finish();
			break;

		case R.id.AMBtnQuit:
			super.finish();
			break;

		default:
			break;
		}

	}


}
